package org.jsola.contract.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.contract.dto.VariableAddDTO;
import org.jsola.contract.dto.VariableUpdateDTO;
import org.jsola.contract.query.VariableQuery;
import org.jsola.contract.vo.VariableListVO;
import org.jsola.contract.vo.VariableVO;
import org.jsola.core.Page;
import org.jsola.core.Result;

import java.util.List;

/**
 * 模板变量
 *
 * @author JanusMix
 */
@Api(tags = "contract-模板变量")
public interface IVariableControllerAPI {

    /**
     * 新增模板变量
     * @param variableAddDTO 模板变量新增实体
     * @return 模板变量展示对象
     */
    @ApiOperation(value = "新增模板变量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableAddDTO", dataType = "VariableAddDTO", value = "新增模板变量", paramType = "body")
    })
    Result<VariableVO> save(VariableAddDTO variableAddDTO);


    /**
     * 修改模板变量
     * @param variableUpdateDTO 模板变量
     * @return 更新数量
     */
    @ApiOperation(value = "修改模板变量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableUpdateDTO", dataType = "VariableUpdateDTO", value = "修改模板变量", paramType = "body")
    })
    Result<Integer> update(VariableUpdateDTO variableUpdateDTO);




    /**
     * 删除单个模板变量，彻底删除
     * @param variableId 模板变量id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个模板变量，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableId", dataType = "Long", value = "模板变量id", paramType = "path")
    })
    Result<Integer> delete(Long variableId);


    /**
     * 批量删除模板变量，彻底删除
     * @param variableIds 模板变量id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除模板变量，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableIds", dataType = "Long[]", value = "模板变量id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(Long[] variableIds);


    /**
     * 根据模板变量id查询模板变量详情
     * @param variableId 模板变量id
     * @return 模板变量详情
     */
    @ApiOperation(value="根据模板变量id查询模板变量详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableId", dataType = "Long", value = "模板变量id", paramType = "path")
    })
    Result<VariableVO> findById(Long variableId);


    /**
     * 查询模板变量
     * @param variableQuery 模板变量查询参数
     * @return page
     */
    @ApiOperation(value="查询模板变量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableQuery", dataType = "VariableQuery", value = "模板变量查询参数", paramType = "query")
    })
    Result<List<VariableListVO>> listAll(VariableQuery variableQuery);


     /**
     * 分页查询模板变量
     * @param variableQuery 模板变量查询参数
     * @return page
     */
    @ApiOperation(value="分页查询模板变量")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "variableQuery", dataType = "VariableQuery", value = "模板变量查询参数", paramType = "query")
    })
    Result<Page<VariableListVO>> page(VariableQuery variableQuery);


}

